<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>Title</title>
</head>
<body>
<%
    //设置值
//    request.setAttribute("num1", 10);
//    request.setAttribute("num2", 20);
//    request.setAttribute("num3", 30);
//    request.setAttribute("num4", 40);

    pageContext.setAttribute("addr", "兰州");
    request.setAttribute("addr","汉中");
    session.setAttribute("addr","西安");
//    pageContext.getSession().setAttribute("addr","西安");
//    request.getSession().setAttribute("addr","西安");

//    request.getServletContext().setAttribute("addr","成都");
    application.setAttribute("addr","成都");
%>

${requestScope.addr}

<%
//    Integer a = (Integer) request.getAttribute("num1");
//    Integer b = (Integer) request.getAttribute("num2");
//    Integer c = (Integer) request.getAttribute("num3");
    Integer d = (Integer) request.getAttribute("num4");

//    out.println(a + b + c + d);
%>
<%--${num1} + ${num2}--%>
<%--${num1 + num2 + num3 + num4}--%>
</body>
</html>
